/**
 * 
 * Copyright (c) 2013-2013 XXXX XXXXXX, Inc.
 * XXXX Road, XXXX, XXXX State, XXXX Post code, XXXX Country.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of XXXX
 * XXXXXX, Inc. ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with XXXX.
 * 
 * History
 * Date        Ver Author        Change Description
 * ----------- --- ------------- ----------------------------------------
 * 08 Jun 2013 001 Andrew          create elements of add new certificate under technical skills tab
 */
package test.com.sms.selenium.sms.resourcemanagement.util;

import org.openqa.selenium.By;

import test.com.sms.selenium.framework.SeleniumPageUtil;
import test.com.sms.selenium.util.SeleniumUtil;
public class RmAddCompanyTechSkillAddCertificatePageUtil extends SeleniumPageUtil{
	public final static By ADC_BUTTON_CONTINUE = By.xpath("//*[@id='feTechnnicalCertificate']/div/div[text()='Continue']");
	public final static By ADC_BUTTON_CLEAR = By.id("clear-tech-certificate");
	public final static By ADC_BUTTON_CLOSE = By.id("techCertDialogClose");
	
	public final static By ADC_LABEL_CERTIFICATE_NAME = By.xpath("//*[@id='feTechnnicalCertificate']/div[3]/div[1]/div[1]/label");
	public final static By ADC_SELECT_CERTIFICATE_NAME = By.id("abstractCertificateId");
	public final static By ADC_LABEL_TEST_NAME = By.xpath("//*[@id='feTechnnicalCertificate']/div[3]/div[1]/div[2]/label");
	public final static By ADC_LABEL_ASSET_MODEL= By.xpath("//*[@id='feTechnnicalCertificate']/div[3]/div[1]/div[3]/label");
	public final static By ADC_LABEL_PRODUCT_FAMILY = By.xpath("//*[@id='feTechnnicalCertificate']/div[3]/div[1]/div[4]/label");
	public final static By ADC_LABEL_CERTIFICATION_DATE = By.xpath("//*[@id='feTechnnicalCertificate']/div[3]/div[2]/div[1]/label");
	public final static By ADC_INPUT_CERTIFICATION_DATE = By.id("certStartDate");
	public final static By ADC_IMG_CERTIFICATION_DATE = By.xpath("//*[@id='feTechnnicalCertificate']/div[3]/div[2]/div[1]/span");
	public final static By ADC_LABEL_EXPIRATION_DATE = By.xpath("//*[@id='feTechnnicalCertificate']/div[3]/div[2]/div[2]/label");
	public final static By ADC_INPUT_EXPIRATION_DATE = By.id("certExpirationDate");
	public final static By ADC_IMG_EXPIRATION_DATE = By.xpath("//*[@id='feTechnnicalCertificate']/div[3]/div[2]/div[2]/span");
	public final static By ADC_LABEL_DESCRIPTION = By.xpath("//*[@id='feTechnnicalCertificate']/div[3]/div[2]/div[3]/label");
	public final static By ADC_INPUT_DESCRIPTION = By.id("description");
	public final static By ADC_LABEL_UPLOAD_CERTIFICATION = By.xpath("//*[@id='feTechnnicalCertificate']/div[3]/div[2]/div[4]/label");
	public final static By ADC_INPUT_UPLOAD_CERTIFICATION = By.id("techCertificateLogo");
	public final static By ADC_LABEL_UPLOAD_FILE = By.xpath("//*[@id='feTechnnicalCertificate']/div[3]/div[2]/div[5]/label");
	
	// records of certificate
	public final static By ADC_TR_CERTIRICATES = By.xpath("//*[@id='resourcetechnicalskills']/div[5]/div/div[4]/table/tbody/tr");
	
	public static void waitForAddNewCertificatePageToLoad(){
		SeleniumUtil.waitOnElements(new By[]{
				ADC_BUTTON_CONTINUE, ADC_BUTTON_CLEAR, ADC_BUTTON_CLOSE,  
				ADC_SELECT_CERTIFICATE_NAME, ADC_INPUT_CERTIFICATION_DATE, ADC_IMG_CERTIFICATION_DATE, 
				ADC_IMG_EXPIRATION_DATE, ADC_INPUT_DESCRIPTION, ADC_INPUT_UPLOAD_CERTIFICATION
		});
		SeleniumUtil.assertTrue(SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(ADC_BUTTON_CONTINUE)));
		SeleniumUtil.assertTrue(SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(ADC_BUTTON_CLEAR)));
		SeleniumUtil.assertTrue(SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(ADC_BUTTON_CLOSE)));
		SeleniumUtil.assertTrue(SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(ADC_SELECT_CERTIFICATE_NAME)));
		SeleniumUtil.assertTrue(SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(ADC_INPUT_CERTIFICATION_DATE)));
		SeleniumUtil.assertTrue(SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(ADC_IMG_CERTIFICATION_DATE)));
		SeleniumUtil.assertTrue(SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(ADC_IMG_EXPIRATION_DATE)));
		SeleniumUtil.assertTrue(SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(ADC_INPUT_DESCRIPTION)));
		SeleniumUtil.assertTrue(SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(ADC_INPUT_UPLOAD_CERTIFICATION)));
	}
}
